#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QMessageBox>
#include <QDebug>
#include <QPixmap>
#include <QStandardItemModel>
#include <QTcpSocket>
#include <QtNetwork>
#include <QTimer>
#include "goods.h"
#include "sqlite.h"
#include "userinfo.h"
#include "conn.h"


namespace Ui {
class Widget;
}

class Widget : public QWidget
{
    Q_OBJECT

public:
    explicit Widget(QWidget *parent = 0);
    void tableview_setmodel();


    ~Widget();
public slots:
    void recvInfo();
private slots:
    void on_pushButton_clicked();
    void on_pushButton_2_clicked();
    void on_pushButton_6_clicked();
    void on_pushButton_8_clicked();
    void on_pushButton_13_clicked();
    void on_pushButton_3_clicked();
    void on_pushButton_7_clicked();
    void on_pushButton_5_clicked();
    void on_pushButton_16_clicked();
    void on_pushButton_23_clicked();
    void on_pushButton_22_clicked();
    void on_pushButton_18_clicked();

    void on_pushButton_20_clicked();

    void on_pushButton_24_clicked();

    void on_pushButton_21_clicked();

    void on_pushButton_27_clicked();

    void on_pushButton_26_clicked();

    void on_pushButton_25_clicked();

    void on_pushButton_19_clicked();

    void on_pushButton_28_clicked();

    void on_pushButton_29_clicked();

    void on_tempControl_clicked();
    void update();


    void on_pushButton_17_clicked();

    void on_pushButton_30_clicked();

    void on_pushButton_9_clicked();

    void on_pushButton_4_clicked();

    void on_sendTemp_clicked();

    void on_pushButton_32_clicked();

    void on_sendHum_clicked();

    void on_pushButton_11_clicked();

    void on_humControl_clicked();

    void on_lightControl_clicked();

    void on_sendLight_clicked();

    void on_pushButton_12_clicked();

    void on_fanOn_clicked();

    void on_fanOff_clicked();

    void on_buzOn_clicked();

    void on_buzOff_clicked();

    void on_lightOn_clicked();

    void on_lightOff_clicked();

private:
    Ui::Widget *ui;
    Sqlite sql;
    Userinfo usersql;
    Goods goods[10];
    QTcpSocket *socket;
    QString buf;
    QTimer *timer;
};

#endif // WIDGET_H
